﻿
@{
    ViewBag.Title = "UserPassWord";
    Layout = "~/Views/Shared/_MyLayout.cshtml";
}

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>密码修改</legend>
</fieldset>
<div style="margin-left:50px;width:100%;">
    <form class="layui-form" enctype="multipart/form-data">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label" style="width:110px;">输入原始密码</label>
                <div class="layui-input-inline">
                    <input type="password" id="OldPass" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">输入新密码</label>
                <div class="layui-input-inline">
                    <input type="password" id="NewPass" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <label class="layui-form-label"></label>
                    <button type="button" class="layui-btn" id="BtnSave">修改</button>
                </div>
            </div>
        </div>

    </form>
</div>
<div style="font-size:12px;margin-top:10px;margin-bottom:10px;margin-left:15px;width:100%;position: absolute;left: 0px;bottom: 0px;">
    ©2020 德器(重庆)科技有限公司|DEQI(CQ) TECHNOLOGY.CO.,LTD 服务热线 400-9019-505
    @*重庆环元环境科学研究院*@
</div>
<script type="text/javascript">

    layui.use(['form', 'table', 'upload', 'layer'], function () {
        var form = layui.form;
        var admin = layui.admin;
        $("#BtnSave").on("click", function () {
            var OldPass = $("#OldPass").val();
            var NewPass = $("#NewPass").val();
            if (OldPass == "" || NewPass == "") {
                alert("请数据密码");
                return;
            }

            $.ajax({
                type: "POST",
                url: "/Panel/UserPassChange",
                async: false,
                data: { "OldPass": OldPass, "NewPass": NewPass },
                success: function (msg) {
                    if (msg.result == "OK") {
                        alert("密码修改成功");
                        //layer.msg('新增成功', { icon: 6, time: 3000 });
                        parent.layui.admin.events.closeThisTabs();

                    } else {
                        alert(msg.result);
                    }
                }
            });
        });



    });


</script>

